package com.jianguo.web.controller.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jianguo.common.core.controller.BaseController;
import com.jianguo.common.core.domain.AjaxResult;
import com.jianguo.companion.domain.PzComment;
import com.jianguo.companion.service.IPzCommentService;

import com.jianguo.order.domain.PzOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api/comment")
public class CommentApi extends BaseController {
    @Autowired
    private IPzCommentService pzCommentService;

    @GetMapping(value = "/getinfo")
    public AjaxResult getinfo(String id){
        LambdaQueryWrapper<PzComment> queryWrapper = new LambdaQueryWrapper<PzComment>()
                .eq(PzComment::getCompanionId, id);
//        PzComment one = pzCommentService.getOne(queryWrapper);
        List<PzComment> list = pzCommentService.list(queryWrapper);
        return success(list);


    }
}
